home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / image / multi207.zip / START.BAS < prev    next >
BASIC Source File  |  1997-03-18  |  6KB  |  384 lines

  1. '0.20
  2. $com 0
  3. $error all off
  4. $lib com off, lpt on, graph off, fullfloat off, iprint off
  5. $option autodim off, cntlbreak off
  6. $sound 0
  7.  
  8. menu:
  9. cls
  10. print "F1- Help
  11. print
  12. print "F2- Display the documentation
  13. print
  14. print "F3- Print the documentation
  15. print
  16. print "Esc- Quit
  17.  
  18. menuloop:
  19. gosub presskey
  20.  
  21. if a$=chr$(27) then
  22.      cls
  23.      end
  24. end if
  25.  
  26. if a$=chr$(0)+chr$(59) then
  27.      gosub helpscre
  28.      goto menu
  29. end if
  30.  
  31. if a$=chr$(0)+chr$(60) then
  32.      file$="mscope.doc"
  33.      gosub displayf
  34.      goto menu
  35. end if
  36.  
  37. if a$=chr$(0)+chr$(61) then
  38.      file$="mscope.doc"
  39.      gosub printfil
  40.      goto menu
  41. end if
  42.  
  43. goto menuloop
  44.  
  45. displayf:
  46. dim pageup$(9999)
  47. cls
  48. open "i",1,file$
  49. print
  50. color 0,7
  51. print "Loading...."
  52. color 7,0
  53.  
  54. gosub loadline
  55. if count<0 then count=0
  56. cls
  57.  
  58. printlin:
  59. print pageup$(count)
  60. count=count+1
  61. lin=lin+1
  62.  
  63. if lin=22 then
  64.      if count>lineload and endoffil=1 then doendstu
  65.      gosub pausescr
  66.      gosub processk
  67.      if a$=chr$(27) then 
  68.           close 1
  69.           count=0
  70.           lin=0
  71.           lineload=0
  72.           pageup=0
  73.           endoffil=0
  74.           return
  75.      end if
  76.      lin=0
  77. end if
  78.  
  79. if count>9999 then count=9999
  80.  
  81. doendstu:
  82. if count>lineload then
  83.      if endoffil=1 then
  84.           gosub pausescr
  85.           gosub processk
  86.           if a$=chr$(27) then
  87.                close 1
  88.                count=0
  89.                lin=0
  90.                lineload=0
  91.                pageup=0
  92.                endoffil=0
  93.                return
  94.           end if
  95.           lin=0
  96.           if pageup=1 then
  97.                pageup=0
  98.                goto printlin
  99.           end if
  100.           count=count-22
  101.           if endwatch<22 then count=0
  102.           goto printlin
  103.      end if
  104.      gosub loadline
  105.      count=count+1
  106. end if
  107.  
  108. goto printlin
  109.  
  110. pausescr:
  111. a$=inkey$
  112. if a$="" then goto pausescr
  113. cls
  114. return
  115.  
  116. processk:
  117. if a$=chr$(27) then return
  118.  
  119. if a$=chr$(0)+chr$(73) then
  120.          gosub parsescr
  121.          gosub pausescr
  122.          goto processk
  123. end if
  124.  
  125. if a$=chr$(0)+chr$(79) then
  126.      gosub loadline
  127.      count=count-22
  128. end if
  129.  
  130. if ucase$(a$)="F" then
  131.      color 0,7
  132.      input "Find: ",findtex$
  133.      gosub findtext
  134. end if
  135.  
  136. if ucase$(a$)="A" then gosub findtext
  137. return
  138.  
  139. loadline:
  140.  
  141. if a$=chr$(0)+chr$(79) then
  142.      if endoffil=0 then
  143.           while not eof(1)
  144.                line input #1, lin$
  145.                if eof(1)=-1 then endoffil=1
  146.                count=count+1
  147.                pageup$(count)=lin$
  148.                lineload=lineload+1
  149.           wend
  150.           count=count+1
  151.           lineload=count
  152.           return
  153.      end if
  154.      if endoffil=1 then
  155.           count=lineload
  156.           return
  157.      end if
  158. end if
  159.  
  160. lineload=lineload+250
  161.  
  162. loadloop:
  163.  
  164. if eof(1)=-1 then
  165.      endoffil=1
  166.      lineload=count
  167.      endwatch=endwatch+1
  168.      count=count-endwatch
  169.      return
  170. end if
  171.  
  172. if lineload>9999 then lineload=9999
  173.  
  174. line input#1, lin$
  175. pageup$(count)=lin$
  176.  
  177. if count=lineload then
  178.      count=count-250
  179.      endwatch=0
  180.      return
  181. end if
  182.  
  183. count=count+1
  184. endwatch=endwatch+1
  185.  
  186. goto loadloop
  187.  
  188. findtext:
  189. color 0,7
  190. print "Searching for: ";findtex$
  191. color 7,0
  192. if lcase$(findtex$)=findtex$ then goto anycase
  193.  
  194. if endoffil=1 then
  195.      savecoun=count
  196.      count=foundcou
  197.  
  198. endoffio:
  199.      count=count+1
  200.      if instr(pageup$(count),findtex$)>0 then
  201.           foundcou=count
  202.           return
  203.      end if
  204.      if count=lineload then
  205.           foundcou=0
  206.           count=savecoun
  207.           count=count-23
  208.           if count<0 then count=0
  209.           savecoun=0
  210.           return
  211.      end if
  212. goto endoffio
  213. end if
  214.  
  215. savecoun=count
  216. count=foundcou
  217.  
  218. notendof:
  219. count=count+1
  220.  
  221. if instr(pageup$(count),findtex$)>0 then
  222.      foundcou=count
  223.      return
  224. end if
  225.  
  226. if count>lineload then gosub loadline
  227.  
  228. if eof(1)=-1 then
  229.      foundcou=0
  230.      endoffil=1
  231.      count=savecoun
  232.      count=count-23
  233.      savecoun=0
  234.      return
  235. end if
  236.  
  237. goto notendof
  238.  
  239. return
  240.  
  241. anycase:
  242.  
  243. if endoffil=1 then
  244.      savecoun=count
  245.      count=foundcou
  246.  
  247. endoffia:
  248.      count=count+1
  249.  
  250.      if instr(ucase$(pageup$(count)),ucase$(findtex$))>0 then
  251.           foundcou=count
  252.           return
  253.      end if
  254.      if count=lineload then
  255.           foundcou=0
  256.           count=savecoun
  257.           count=count-23
  258.           if count<0 then count=0
  259.           savecoun=0
  260.           return
  261.      end if
  262.  
  263.      goto endoffia
  264. end if
  265.  
  266. savecoun=count
  267. count=foundcou
  268.  
  269. notendoa:
  270. count=count+1
  271.  
  272. if instr(ucase$(pageup$(count)),ucase$(findtex$))>0 then
  273.      foundcou=count
  274.      return
  275. end if
  276.  
  277. if count>lineload then gosub loadline
  278.  
  279. if eof(1)=-1 then
  280.      foundcou=0
  281.      endoffil=1
  282.      count=savecoun
  283.      count=count-23
  284.      savecoun=0
  285.      return
  286. end if
  287.  
  288. goto notendoa
  289.  
  290. return
  291.  
  292. parsescr:
  293. count=count-44
  294. if count<0 then count=0
  295. linecoun=0
  296.  
  297. parseloo:
  298. print pageup$(count)
  299. linecoun=linecoun+1
  300. count=count+1
  301.  
  302. if linecoun=22 then
  303.      pageup=1
  304.      return
  305. end if
  306.  
  307. goto parseloo
  308.  
  309. lastpage:
  310. gosub pausescr
  311. gosub processk
  312. lin=0
  313. return
  314.  
  315. printfil:
  316. open "i",1,file$
  317.  
  318. heading:
  319. cls
  320. print "Printing...";
  321. print
  322. print
  323. print "Press space bar to pause printing, or Esc to quit.
  324. print
  325. print
  326.  
  327. printmor:
  328. line input# 1, lin$
  329. lprint lin$
  330. a$=inkey$
  331.  
  332. if a$=chr$(27) then
  333. print "Printing has been terminated.  The printer may still have data in its
  334. print "buffer.  If so, it will continue printing until the buffer is empty.
  335. lprint chr$(12)
  336. close 1
  337. print
  338. print
  339. return
  340. end if
  341.  
  342. if a$=chr$(32) then
  343. print "Press any key to resume printing. ";
  344. gosub presskey
  345. if eof(1) then goto eofp
  346. goto heading
  347. end if
  348.  
  349. if eof(1) then goto eofp
  350.  
  351. goto printmor
  352.  
  353. eofp:
  354. print "Finished.
  355. close 1
  356. lprint chr$(12)
  357. return
  358.  
  359. presskey:
  360. a$=inkey$
  361. if a$="" then goto presskey
  362. return
  363.  
  364. helpscre:
  365. cls
  366. print "Pressing the F1 key gets you this screen.
  367. print
  368. print "Pressing the F2 key lets you display the file on the screen.
  369. print
  370. print "Use PgDn to go forward, PgUp to go back, and Esc to quit.  The F key lets
  371. print "you find a specific phrase, and the A key will let you search for that phrase 
  372. print "again.
  373. print
  374. print "To move to the end of the file, use the End key.
  375. print
  376. print "To print the file, just turn on your printer, make sure it's ready to go, and 
  377. print "press F3.
  378. print
  379. print
  380. print "Press a key... ";
  381. gosub presskey
  382. return
  383. 
  384.